package com.imaker.ajax.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.imaker.action.BaseAction;
import com.imaker.domain.ActionInfo;
import com.imaker.domain.ActionOperateInfo;
import com.imaker.domain.RoleActionOperateInfo;
import com.imaker.domain.RoleInfo;
import com.imaker.service.ActionOperateService;
import com.imaker.service.ActionService;
import com.imaker.service.RoleActionOperateService;
import com.opensymphony.xwork2.ActionContext;

@Controller
@Scope("prototype")
public class AjaxRoleOperateAction extends BaseAction{

	@Autowired
	private RoleActionOperateService roleActionOperateService = null;
	@Autowired
	private ActionService actionService;
	@Autowired
	private ActionOperateService actionOperateService = null;
	private RoleActionOperateInfo roleActionOperateInfo;
	private List<RoleActionOperateInfo> roleActionOperateList;
	private ActionOperateInfo actionOperate;
	private RoleInfo roleInfo;
	private List<ActionInfo> actionList;
	private String actionId;
	private String roleId;
	private String flag;
	
	/**
	 * 保存
	 * @return
	 */
	public String saveRoleOperate(){
		
		return SUCCESS;
	}
	
	/**
	 * 更新
	 */
	public String updateRoleOperate() throws Exception{
		roleActionOperateService.update(idList, flag,roleId);
		return SUCCESS;
	}

	public RoleActionOperateService getRoleActionOperateService() {
		return roleActionOperateService;
	}

	public void setRoleActionOperateService(
			RoleActionOperateService roleActionOperateService) {
		this.roleActionOperateService = roleActionOperateService;
	}

	public ActionService getActionService() {
		return actionService;
	}

	public void setActionService(ActionService actionService) {
		this.actionService = actionService;
	}

	public ActionOperateService getActionOperateService() {
		return actionOperateService;
	}

	public void setActionOperateService(ActionOperateService actionOperateService) {
		this.actionOperateService = actionOperateService;
	}

	public RoleActionOperateInfo getRoleActionOperateInfo() {
		return roleActionOperateInfo;
	}

	public void setRoleActionOperateInfo(RoleActionOperateInfo roleActionOperateInfo) {
		this.roleActionOperateInfo = roleActionOperateInfo;
	}

	public List<RoleActionOperateInfo> getRoleActionOperateList() {
		return roleActionOperateList;
	}

	public void setRoleActionOperateList(
			List<RoleActionOperateInfo> roleActionOperateList) {
		this.roleActionOperateList = roleActionOperateList;
	}

	public List<ActionInfo> getActionList() {
		return actionList;
	}

	public void setActionList(List<ActionInfo> actionList) {
		this.actionList = actionList;
	}

	public String getActionId() {
		return actionId;
	}

	public void setActionId(String actionId) {
		this.actionId = actionId;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	public ActionOperateInfo getActionOperate() {
		return actionOperate;
	}

	public void setActionOperate(ActionOperateInfo actionOperate) {
		this.actionOperate = actionOperate;
	}
	
}
